#ifndef _DATAPOINT_H
#define _DATAPOINT_H

///* Includes ------------------------------------------------------------------*/
//#include "Time.h"
////#include "Frame.h"
//#include "Address.h"
//#include "SysConfig.h"
///* Private typedef -----------------------------------------------------------*/

enum COMBI_COMMAND
{
     SetUpSet = 0,
     SetDownSet,
     SetStopSet,
	   SetUpDown,
	   SetDownUp,
	   SetStopUp,
	   SetStopDown,
	   SetStopStop,
	   SetUpUp,
	   SetDownDown,
	   SetDownStop
   	//MSTATE_RUN_DEC,    
};
/* Private define ------------------------------------------------------------*/
#define DY_Config_Null                 0x00
#define DY_Config_ValidOneP2           0x01
#define DY_Config_ValidTwoP2           0x02

#define DY_Config_RepeatPair           0x03

#define DY_Config_P2Up                 0x10

#define DY_Config_P2Stop               0x20

#define DY_Config_P2Down               0x30

#define DY_Config_AdjustUpRoute        0x40
#define DY_Config_AdjustDownRoute      0x41

#define DY_Config_UpDown5Sec           0x50
#define COMBINATION_DELAY              4000
/* Private macro -------------------------------------------------------------*/

typedef struct
{
  uint8_t CombinationFlag;
	uint16_t ComDelay;
	uint8_t Times;
	uint8_t KeyValue[4];
} COMBINATION_CMD;    
//COMBINATION

/* Private variables ---------------------------------------------------------*/
/* Referencing variables -----------------------------------------------------*/
extern RUNTIMECOMPARE RunTimeCompare;
extern volatile uint8_t DY_LastCmd;
extern volatile uint16_t DY_SameCmdDelay;
extern volatile COMBINATION_CMD CombinationCmd;
extern volatile SAVE_COMMON_VARIABLE CurRunMsg;
/* Private function ----------------------------------------------------------*/
/* Referencing functions -----------------------------------------------------*/
extern void DooyaMotorProcess(uint8_t Cmd);
extern void DooyaMotorAdjustProcess(ADJUSTFRAME *RxPtr);
extern void DooyaProtocolProcess(uint8_t Cmd,uint8_t ValidNo);
extern uint8_t DooyaProtocolPairProcess(uint8_t Cmd,uint8_t ValidNo);
extern void SetLimitHandler(SYSMEM *sys);
extern void DeleteLimitValue(SYSMEM* sys);
extern void HostMotorRunAngle(uint16_t angle);
extern void SaveSpeedGrade(void);
extern void ChangeDirection(void);
extern void cmd_down(uint8_t dot_flag);
extern void cmd_up(uint8_t dot_flag);

#endif
